package com.qing.request_params.controller;

import com.qing.request_params.entity.Person;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
public class HelloController {


	@PostMapping
	public void editPerson(@RequestBody Person person) {
		System.out.println(person.toString());
	}

	@GetMapping
	public Person getPerson(String name, int age) {
		Person person = new Person(name, age);
		return person;
	}
}
